home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / decprom / RCS / mem.c,v < prev    next >
Encoding:
Text File  |  1990-02-17  |  1.6 KB  |  96 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.16.16.14.15;  author shirriff;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @/* 
  26.  * mem.c --
  27.  *
  28.  *    A simple (and small) memory allocator for the SCSI disk bootstrap
  29.  *    program.
  30.  *
  31.  * Copyright 1989 Regents of the University of California
  32.  * Permission to use, copy, modify, and distribute this
  33.  * software and its documentation for any purpose and without
  34.  * fee is hereby granted, provided that the above copyright
  35.  * notice appear in all copies.  The University of California
  36.  * makes no representations about the suitability of this
  37.  * software for any purpose.  It is provided "as is" without
  38.  * express or implied warranty.
  39.  */
  40.  
  41. #ifdef notdef
  42. static char rcsid[] = "$Header: /sprite/src/boot/dsprom/RCS/mem.c,v 1.1 90/02/13 23:40:35 shirriff Exp $ SPRITE (Berkeley)";
  43. #endif /* not lint */
  44.  
  45. #include "sprite.h"
  46.     extern int end;
  47.  
  48. static char *memEnd = (char *) &end;
  49.  
  50. /*
  51.  *----------------------------------------------------------------------
  52.  *
  53.  * malloc --
  54.  *
  55.  *     Allocate a block of memory of the given size starting at the
  56.  *     current end of kernel memory.
  57.  *
  58.  * Results:
  59.  *    A pointer to the allocated memory
  60.  *
  61.  * Side effects:
  62.  *    None.
  63.  *
  64.  *----------------------------------------------------------------------
  65.  */
  66.  
  67.  
  68.  
  69. char *
  70. malloc(numBytes)
  71. {
  72.     char    *addr;
  73.  
  74.     addr =  memEnd;
  75.  
  76.     memEnd += (numBytes + 3) & ~3;
  77.     bzero(addr, numBytes);
  78.     return(addr);
  79. }
  80.  
  81. void
  82. free(address)
  83.     char *address;
  84. {
  85.     return;
  86. }
  87. void
  88. _free(address)
  89.     char *address;
  90. {
  91.     return;
  92. }
  93.  
  94.  
  95. @
  96.